package com.barneyx.mshinfoplatform.entity.admin;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.barneyx.mshinfoplatform.entity.CommonEntity;
import com.gitee.sunchenbin.mybatis.actable.annotation.*;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlCharsetConstant;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlEngineConstant;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@TableName("msh_admin_permission_list")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableEngine(MySqlEngineConstant.InnoDB)
@TableCharset(MySqlCharsetConstant.UTF8)
@ApiModel("管理员表-权限列表")
public class AdminPermissionEntity extends CommonEntity {
    @TableId(value = "permission_id", type = IdType.ASSIGN_ID)
    @Column(type = MySqlTypeConstant.BIGINT)
    private String PermissionId;

    @TableField("permission_parent_id")
    @Column(type = MySqlTypeConstant.BIGINT)
    private String PermissionParentId;

    @TableField("permission_level")
    @Column(type = MySqlTypeConstant.INT,defaultValue = "1")
    private String PermissionLevel;

    @TableField("permission_cate")
    @Column(type = MySqlTypeConstant.CHAR)
    private String PermissionCateCode;

    @TableField("permission_name")
    private String PermissionName;

    @TableField("permission_code")
    @Column(type = MySqlTypeConstant.CHAR)
    @Unique
    @Index
    public String PermissionCode;


    @TableField("permission_remark")
    private String PermissionRemark;


    @TableField(exist = false)
    private List<AdminPermissionEntity> children = new ArrayList<>();


}
